﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using Maticsoft.DBUtility;//Please add references
namespace Maticsoft.DAL
{
	/// <summary>
	/// 数据访问类:Magazine
	/// </summary>
	public partial class Magazine
	{
        public int DeleteByIds(string ids)
        {
            string strSql = "delete magazine where magazineId in(" + ids + ")";
            return DbHelperSQL.ExecuteSql(strSql);
        }

        public DataSet GetYear(string strWhere)
        {
            string strSql = "select year from magazine";
            if (strWhere != "")
            {
                strSql += " where " + strWhere;
            }
            strSql += " group by year order by convert(int,year) asc";

            return DbHelperSQL.Query(strSql);
        }

        public DataSet GetPeriod(string strWhere)
        {
            string strSql = "select period from magazine";
            if (strWhere != "")
            {
                strSql += " where " + strWhere;
            }
            strSql += " group by period order by convert(int,period) asc";

            return DbHelperSQL.Query(strSql);
        }
	}
}

